define([],function(){
    var tpl = {};
    /*  生活事件量表 --  指导语*/
    tpl.instruction = function(){
        var html = '';
        html += instruction();
        return html;
    };
    var instruction = function(){
        return '<script type="text/html" id="instruction-tpl">'+
                    '<div class="panel panel-default">'+
                        '<div class="panel-heading">指导语</div>'+
                        '<div class="panel-body instruction">'+
                            '<p>{{description}}</p>'+
                        '</div>'+
                        '<div class="panel-heading text-center">'+
                            '<button class="btn btn-info" id="toStart">开始答题</button>'+
                        '</div>'+
                    '</div>'+
                '</script>'
    };
    /*
    * 页面布局盒子：
    * */
    tpl.layoutBox = function(){
        var html = '';
        html += layoutBox();
        return html;
    };
    var layoutBox =  function(){
        return '<script type="text/html" id="layoutBox-tpl">'+
                '<div class="ques-tabs" id="ques-tabs">'+
                '</div>'+
                '<div class="wrap" id="wrap">'+
                '</div>'+
                '</script>'
    };

    /*  页面布局  */
    tpl.layout = function(){
        var html = '';
        html += layout();
        return html;
    };
    var layout =  function(){
        return '<script type="text/html" id="layout-tpl">'+
                    '<div class="wrap_left" id="wrap_left" style="width:{{width}}">'+
                        '<div class="questionnaire" id="questionnaire">'+
                        '</div>'+
                        '<div class="questionnaire_operate">'+
                            '<div id="ques-click-group">'+
                                '<div class="clearfix ques-click-group-osi" id="ques-click-group-osi">'+
                                '</div>'+
                                '<div class="clearfix ques-click-group-les" id="ques-click-group-les">'+
                                '</div>'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
                    '<div class="wrap_right" id="wrap_right">'+
                    '</div>'+
                '</script>'
    };
    /*
    * 下方按钮操作区：
    * */
    //osi
    tpl.btnGroupOsi = function(){
        var html = '';
        html += btnGroupOsi();
        return html;
    };
    var btnGroupOsi = function(){
        return '<script type="text/html" id="btnGroupOsi-tpl">'+
                    '<div>本{{if type == "GLE"}}阶段{{else}}组{{/if}}共<font id="groupNo">{{lens}}</font>题</div>'+
                    '<div class="clearfix pull-right btn-groups">'+
                        '<button class="btn btns" item = "{{data[0].listNo}}">第1题</button>'+
                        '<button class="btn btns" group="prev">上一题</button>'+
                        '{{each data as list}}'+
                        '<button class="btn btns" item = "{{list.listNo}}" type="btnList" >{{list.backId}}</button>'+
                        '{{/each}}'+
                        '<button class="btn btns" group = "next">下一题</button>'+
                    '</div>'+
                '</script>'
    };
    //les
    tpl.btnGroupLes = function(){
        var html = '';
        html += btnGroupLes();
        return html;
    };
    var btnGroupLes = function(){
        return '<script type="text/html" id="btnGroupLes-tpl">'+
                    '<div class="clearfix">'+
                        '<div>本阶段共<font id="groupNo">{{lens}}</font>组</div>'+
                        '<div class="clearfix pull-right btn-groups">'+
                            '<button class="btn btns" group = "prev" item = "group">上一组</button>'+
                            '<button class="btn btns" group = "next" item = "group">下一组</button>'+
                        '</div>'+
                    '</div>'+
                    '<div class="clearfix">'+
                        '<div>本组共<font>5</font>题</div>'+
                        '<div class="clearfix pull-right btn-groups">'+
                            '<button class="btn btns" group = "prev" item = "question">上一题</button>'+
                            '<button class="btn btns" group = "next" item = "question">下一题</button>'+
                        '</div>'+
                    '</div>'+
                '</script>'
    };
    /*  题目切换卡  */
    tpl.quesTab = function(){
        var html = '';
        html += quesTab();
        return html;
    };
    var quesTab = function(){
        return '<script type="text/html" id="quesTab-tpl">'+
                    '<div class="tab tab_checked"> {{if type == "GLE"}} 一般人口学信息 {{else if type == "OSI"}}职业压力紧张问卷{{/if}}</div>'+
                '</script>'
    }
    /*  右侧答题进度列表*/
    tpl.projectSchedule = function(){
        var html = '';
        html += projectSchedule();
        return html;
    };
    var projectSchedule = function(){
        return '<script type="text/html" id="projectSchedule-tpl">'+
                '<div class="panel panel-default">'+
                    '<div class="panel-heading text-center">答题进度</div>'+
                    '<div class="panel-body">'+
                        '<ul class="project_schedule">'+
                            '{{each data as value,i}}'+
                            '<li {{if i == 0}} class="clearfix doing" {{/if}} {{if value.group}} group ="{{value.group}}"{{/if}} length="{{value.lens}}">'+
                                '<div class="schedule-title">'+
                                    '<i class="{{if i != 0}}fa fa-clock-o {{else}}fa fa-crosshairs{{/if}}" aria-hidden="true"></i>'+
                                '</div>'+
                                '<div>{{value.title}}(<font class="doneNo">{{if i == 0}}1{{else}}0{{/if}}</font>/{{value.lens}})</div>'+
                            '</li>'+
                            '{{/each}}'+
                        '</ul>'+
                    '</div>'+
                '</div>'+
            '</script>'
    };
    /*
    * 加载题目：OSI
    * */
    tpl.questionType2 = function(){
        var html = '';
        html += mark();
        html += singleElectionOsi();
        html += blankOsi();
        html += blankList();
        html += single();
        html += blank();
        html += list();
        html += blankSingle();
        html += linkage();
        html += questionType2();
        return html;
    };
    var questionType2 = function(){
        return '<script type="text/html" id="questionType2-tpl">'+
                '{{if type == "single" || type == "checkbox"}}'+
                    '{{include "singleElectionOsi-tpl" }}'+
                '{{else if type == "blank"}}'+
                    '{{include "blankOsi-tpl" }}'+
                '{{else if type == "blankList"}}'+
                    '{{include "blankList-tpl" }}'+   
                '{{else if type == "linkage"}}'+
                    '{{include "linkage-tpl" }}'+
                '{{/if}}'+
            '</script>'
    };

    /*
    * 加载题目：LES:
    * */
    tpl.questionType = function(){
        var html = '';
        html += singleElection();
        html += singleElection2();
        html += singleElection3();
        html += timePoint();
        html += timeQuantum();
        html += mark();
        html += questionType();
        return html;
    };
    var questionType = function(){
        return '<script type="text/html" id="questionType-tpl">'+
                '{{if id == "1" || id == "4"}}'+
                    '{{include "singleElection-tpl" }}'+
                '{{else if id == "2"}}'+
                    '{{include "singleElection2-tpl" }}'+
                '{{else if id == "3"}}'+
                    '{{include "singleElection3-tpl" }}'+
                '{{else if id == "5"}}'+
                    '{{if name == "5.请填写该事件发生的年月:"}}'+
                        '{{include "timePoint-tpl" }}'+
                    '{{else}}'+
                        '{{include "timeQuantum-tpl" }}'+
                    '{{/if}}'+
                '{{/if}}'+
                '</script>'
    };

    var mark = function(){
        return '<script type="text/html" id="mark-tpl">'+
                    '<p>备注：</p>'+
                    '<ul>'+
                        '{{if bak}}'+
                            '{{each bak as mark,i}}'+
                                '<li>{{i+1}}. {{mark.mark}}</li>'+
                            '{{/each}}'+
                        '{{else}}'+
                            '无' +   
                        '{{/if}}'+    
                    '</ul>'+
                '</script>'
    }
    /* 问卷题型 */
    /*
    * 联动：
     */
    var linkage = function(){
        return '<script type="text/html" id="linkage-tpl">'+
                    '<div class="panel panel-default" id="{{id}}" length="{{length}}" number="{{listNo}}" type="{{type}}" quesType="osi">'+
                        '<div class="panel-heading">{{itemTitle}}</div>'+
                        '<div class="panel-body">'+
                            '{{each list as li,i}}'+
                                '{{if li.type == "single" || li.type == "checkbox"}}'+
                                    '{{include "single-tpl" li}}'+
                                '{{else if li.type == "blank"}}'+
                                    '{{include "blank-tpl" li}}'+
                                '{{else if li.type == "blankList"}}'+
                                    '{{include "list-tpl" li}}'+   
                                '{{else if li.type == "blankSingle"}}'+
                                    '{{include "blankSingle-tpl" li}}'+
                                '{{/if}}'+
                            '{{/each}}'+ 
                            '<div class="text-center jump"><button type="button" class="btn btn-pri text-center" id="toSureNext">确认</button></div>'+
                            '<div class="mark">'+
                                '{{include "mark-tpl"}}'+
                            '</div>'   +
                        '</div>'+
                    '</div>'+
            '</script>'
    } 
    var blankSingle = function(){
        return '<script type="text/html" id="blankSingle-tpl">'+
                '<div id="{{id}}" type="{{type}}" {{if !value}}{{if css == "none"}}style="display:none"{{/if}}{{/if}}>'+
                    '<div class="ques">'+
                        '{{each description as val,i}}'+
                            '{{if val.item == "text"}}'+
                                '<input type="text" class="form-control w-150" value="{{value}}">'+
                            '{{else if val.item == "number"}}'+
                                '<input type="number" class="form-control w-150" min="0" value="{{value}}">'+
                            '{{else if val.item == "time"}}'+
                                '<input type="time" class="form-control w-150" min="8:00" {{if value}} value="{{value}}" {{else}} value="00:00" {{/if}}>'+
                            '{{else if val.item == "date"}}'+
                                '<input type="date" class="form-control w-150"  value="{{value}}" maxDate = "{{val.maxDate}}">'+
                            '{{else}}'+
                                '{{val.item}}'+
                            '{{/if}}'+
                        '{{/each}}'+
                        '{{bak}}'+
                    '</div>'+
                    '<div class="clearfix inputNo"  {{if !values }}style="display:none;"{{/if}}>'+
                        '{{each values as op,i}}'+
                            '<input type="date" class="form-control"  value="{{op.val}}" max="{{op.maxDate}}">'+
                        '{{/each}}'+
                    '</div>'+
                    '<div class="clearfix ques_single_tab" {{if !values }} style="display:none;" {{/if}}>'+
                        '{{each option as op,i}}'+
                        '<div class="linkage_tab {{if op.flag == 1}}link_checked {{/if}}" name = "{{op.item}}">{{op.val}}</div>'+
                        '{{/each}}'+
                    '</div>'+
                '</div>'+
            '</script>'
    }
    var blank = function(){
        return '<script type="text/html" id="blank-tpl">'+
                    '<div id="{{id}}" type="{{type}}" {{if !value}} {{if css == "none"}}style="display:none"{{/if}}{{/if}}>'+
                        '<div class="ques" >'+
                            '{{each description as val,i}}'+
                                '{{if val.item == "text"}}'+
                                    '<input type="text" class="form-control w-150" value="{{value}}" >'+
                                '{{else if val.item == "number"}}'+
                                    '<input type="number" class="form-control w-150" min="0" value="{{value}}">'+
                                '{{else if val.item == "time"}}'+
                                    '<input type="time" class="form-control w-150" min="8:00" value="{{value}}">'+
                                '{{else if val.item == "date"}}'+
                                    '<input type="date" class="form-control w-150" value="{{value}}" max="{{val.maxDate}}">'+    
                                '{{else}}'+
                                    '{{val.item}}'+
                                '{{/if}}'+
                            '{{/each}}{{bak}}'+
                        '</div>'+
                    '</div>'+
            '</script>'
    }
    var list = function(){
        return '<script type="text/html" id="list-tpl">'+
                    '<div id="{{id}}" type="{{type}}" {{if !value}}{{if css == "none"}}style="display:none"{{/if}}{{/if}}>'+
                        '<div class="ques">'+
                            '{{each description as value,i}}'+
                                '{{if value.item == "text"}}'+
                                   /* '<input type="text" class="form-control w-150">'+*/
                                '{{else if value.item == "number"}}'+
                                    /*'<input type="number" class="form-control w-150" min="0">'+*/
                                '{{else}}'+
                                    '{{value.item}}'+
                                '{{/if}}'+
                            /*'<span class = "ques_num"></span>'+*/
                            '{{/each}}'+
                        '</div>'+
                        '<div class="blankList">'+
                            '<div class="clearfix">'+
                                '{{if value}}'+
                                    '{{each value as val,i}}'+
                                        '<textarea class="pull-left form-control blank_text" placeholder="请输入具体内容">{{val.val}}</textarea>'+
                                        '{{if val.no == valueLens}}'+
                                        '<button class="btn btn-pri" id="addBlank">添加</button>'+
                                        '{{/if}}'+
                                    '{{/each}}'+
                                '{{else}}'+
                                    '<textarea class="pull-left form-control blank_text" placeholder="请输入具体内容"></textarea>'+
                                    '<button class="btn btn-pri" id="addBlank">添加</button>'+
                                '{{/if}}'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
            '</script>'
    }
    var single = function(){
        return '<script type="text/html" id="single-tpl">'+
                    '<div id="{{id}}" type="{{type}}" {{if !value}}{{if css == "none"}}style="display:none"{{/if}}{{/if}}>'+
                        '<div class="ques">'+
                            '<span class = "ques_num">{{description}}</span>'+
                        '</div>'+
                        '<div class="clearfix ques_single_tab" {{if choose}}choose="{{choose}}" link="{{link}}" link0 = "{{link0}}" link1 = "{{link1}}" {{/if}}>'+
                            '{{each option as op,i}}'+
                            '<div class="linkage_tab {{if op.flag == 1}}link_checked {{/if}}" name = "{{op.item}}">{{op.item}}.{{op.val}}</div>'+
                            '{{/each}}'+
                        '</div>'+
                    '</div>'+
                '</script>'
    }
    //填空：
    var blankOsi = function(){
        return '<script type="text/html" id="blankOsi-tpl">'+
                    '<div class="panel panel-default" id="{{id}}" number="{{listNo}}" length="{{length}}" type="{{type}}" quesType="osi">'+
                        '<div class="panel-heading">{{itemTitle}}</div>'+
                        '<div class="panel-body">'+
                            '<div class="ques">'+
                                '{{each description as val,i}}'+
                                    '{{if val.item == "text"}}'+
                                        '<input type="text" class="form-control w-150" value="{{value}}" >'+
                                    '{{else if val.item == "number"}}'+
                                        '<input type="number" class="form-control w-150" min="0" value="{{value}}" >'+
                                    '{{else if val.item == "time"}}'+
                                        '<input type="time" class="form-control w-150"  value="{{value}}">'+
                                    '{{else if val.item == "date"}}'+
                                        '<input type="date" class="form-control w-150"  value="{{value}}" max="{{val.maxDate}}">'+    
                                    '{{else}}'+
                                        '{{val.item}}'+
                                    '{{/if}}'+
                                '{{/each}}'+
                            '</div>'+
                            '<div class="text-center jump"><button type="button" class="btn btn-pri text-center" id="toSureNext">确认</button></div>'+
                            '<div class="mark">'+
                                '{{include "mark-tpl" }}'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
            '</script>'
    };
    var blankList = function(){
        return '<script type="text/html" id="blankList-tpl">'+
                    '<div class="panel panel-default" id="{{id}}" number="{{listNo}}" length="{{length}}" type="{{type}}" quesType="osi">'+
                        '<div class="panel-heading">{{itemTitle}}</div>'+
                        '<div class="panel-body">'+
                            '<div class="ques">'+
                                '{{each description as value,i}}'+
                                    '{{if value.item == "text"}}'+
                                       /* '<input type="text" class="form-control w-150">'+*/
                                    '{{else if value.item == "number"}}'+
                                        /*'<input type="number" class="form-control w-150" min="0">'+*/
                                    '{{else}}'+
                                        '{{value.item}}'+
                                    '{{/if}}'+
                                /*'<span class = "ques_num"></span>'+*/
                                '{{/each}}'+
                            '</div>'+
                            '<div class="blankList">'+
                                '{{if value}}'+
                                    '{{each value as val,i}}'+
                                        '<div class="clearfix">'+
                                            '<textarea class="pull-left form-control blank_text" placeholder="请输入具体内容">{{val.val}}</textarea>'+
                                            '{{if val.no == valueLens}}'+
                                            '<button class="pull-left btn btn-pri" id="addBlank">添加</button>'+
                                            '{{/if}}'+
                                        '</div>'+
                                    '{{/each}}'+
                                '{{else}}'+
                                    '<div class="clearfix">'+
                                        '<textarea class="pull-left form-control blank_text" placeholder="请输入具体内容"></textarea>'+
                                        '<button class="btn btn-pri" id="addBlank">添加</button>'+
                                    '</div>'+
                                '{{/if}}'+
                            '</div>'+
                            '<div class="text-center jump"><button type="button" class="btn btn-pri text-center" id="toSureNext">确认</button></div>'+
                            '<div class="mark">'+
                                '{{include "mark-tpl"}}'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
            '</script>'
    };
    //osi单选：
    var singleElectionOsi = function(){
        return '<script type="text/html" id="singleElectionOsi-tpl">'+
                    '<div class="panel panel-default" id="{{id}}" length="{{length}}" number="{{listNo}}"  type="{{type}}" quesType="osi">'+
                        '<div class="panel-heading">{{itemTitle}}</div>'+
                        '<div class="panel-body">'+
                            '<div class="ques">'+
                                '<span class = "ques_num">{{description}}</span>'+
                            '</div>'+
                            '<div class="clearfix ques_single_tab">'+
                                '{{each option as op,i}}'+
                                '<div class="linkage_tab {{if op.flag == 1}}link_checked {{/if}}" name = "{{op.item}}">{{op.item}}.{{op.val}}</div>'+
                                '{{/each}}'+
                            '</div>'+
                            '<div class="extralSingle">'+
                                /*'{{if extralSingle}}'+
                                '请填写：<input type="text" class="form-control w-150"  name="{{if extralName}}{{extralName}} {{else}}{{value}} {{/if}}" value="{{extralSingle}}">'+
                                '{{/if}}'+*/
                            '</div>'+
                            '<div class="mark">'+
                                '{{include "mark-tpl"}}'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
                '</script>'
    };

    /* 生活事件量表 */
    // 单选
    var singleElection = function(){
        return '<script type="text/html" id="singleElection-tpl">'+
            '<div class="panel panel-default" id="{{fuId}}.{{id}}" indexNo = "{{indexNo}}" type="singleElection" quesType = "les">'+
                '<div class="panel-heading">{{itemTitle}}</div>'+
                '<div class="panel-body">'+
                    '<div class="ques">'+
                        '<p class = "ques_title">{{ if title}}{{indexNo}} {{/if}}{{title}}</p>'+
                        '<p>{{indexNo}}.{{name}}</p>'+
                    '</div>'+
                    '<div class="clearfix ques_single_tab">'+
                        '<div class="linkage_tab {{if value == "A"}}link_checked {{/if}}" name = "A">{{option.A}}</div>'+
                        '<div class="linkage_tab {{if value == "B"}}link_checked {{/if}}" name = "B">{{option.B}}</div>'+
                        '<div class="linkage_tab {{if value == "C"}}link_checked {{/if}}" name = "C">{{option.C}}</div>'+
                        '<div class="linkage_tab {{if value == "D"}}link_checked {{/if}}" name = "D">{{option.D}}</div>'+
                    '</div>'+
                    '<div class="mark">'+
                        '{{include "mark-tpl"}}'+
                    '</div>'+
                '</div>'+
            '</div>'+
        '</script>'
    };
    // 单选
    var singleElection2 = function(){
        return '<script type="text/html" id="singleElection2-tpl">'+
            '<div class="panel panel-default" id="{{fuId}}.{{id}}" indexNo = "{{indexNo}}" type="singleElection" quesType = "les">'+
                '<div class="panel-heading">{{itemTitle}}</div>'+
                '<div class="panel-body">'+
                    '<div class="ques">'+
                        '<p class = "ques_title">{{ if title}}{{indexNo}} {{/if}}{{title}}</p>'+
                        '<p>{{indexNo}}.{{name}}</p>'+
                    '</div>'+
                    '<div class="clearfix ques_single_tab">'+
                        '<div class="linkage_tab {{if value == "A"}}link_checked {{/if}}" name = "A">{{option.A}}</div>'+
                        '<div class="linkage_tab {{if value == "B"}}link_checked {{/if}}" name = "B">{{option.B}}</div>'+
                    '</div>'+
                    '<div class="mark">'+
                        '{{include "mark-tpl"}}'+
                    '</div>'+
                '</div>'+
            '</div>'+
            '</script>'
    };
    var singleElection3 = function(){
        return '<script type="text/html" id="singleElection3-tpl">'+
            '<div class="panel panel-default" id="{{fuId}}.{{id}}" indexNo = "{{indexNo}}" type="singleElection" quesType = "les">'+
                '<div class="panel-heading">{{itemTitle}}</div>'+
                '<div class="panel-body">'+
                    '<div class="ques">'+
                    '<p class = "ques_title">{{ if title}}{{indexNo}} {{/if}}{{title}}</p>'+
                    '<p>{{indexNo}}.{{name}}</p>'+
                    '</div>'+
                    '<div class="clearfix ques_single_tab ques_single_5">'+
                        '<div class="linkage_tab {{if value == "A"}}link_checked {{/if}}" name = "A" >{{option.A}}</div>'+
                        '<div class="linkage_tab {{if value == "B"}}link_checked {{/if}}" name = "B">{{option.B}}</div>'+
                        '<div class="linkage_tab {{if value == "C"}}link_checked {{/if}}" name = "C">{{option.C}}</div>'+
                        '<div class="linkage_tab {{if value == "D"}}link_checked {{/if}}" name = "D">{{option.D}}</div>'+
                        '<div class="linkage_tab {{if value == "E"}}link_checked {{/if}}" name = "E">{{option.E}}</div>'+
                    '</div>'+
                    '<div class="mark">'+
                        '{{include "mark-tpl"}}'+
                    '</div>'+
                '</div>'+
            '</div>'+
            '</script>'
    };
    //时间点：
    var timePoint = function(){
        return '<script type="text/html" id="timePoint-tpl">'+
                '<div class="panel panel-default" id="{{fuId}}.{{id}}" indexNo = "{{indexNo}}" type="timePoint" quesType = "les">'+
                    '<div class="panel-heading">{{itemTitle}}</div>'+
                    '<div class="panel-body">'+
                        '<div class="ques">'+
                            '<p class = "ques_title">{{ if title}}{{indexNo}} {{/if}}{{title}}</p>'+
                        '</div>'+
                        '<div class="ques">'+
                            '<div class="ques_name">{{indexNo}}.{{name}}</div>' +
                            '<div class="clearfix ques_date">' +
                                '<div>'+
                                    '<input type="date" name="manyTimes" value="{{value}}" max = "{{maxTime}}" class="form-control"/>'+
                                '</div>'+
                                '<div>'+
                                    '{{if !manyTimes}}'+
                                    '<button class="btn btn-pri manyTimes" id="manyTimes">发生多次</button>'+
                                    '<button class="btn none-btn" id="noneDate">没有了</button>' +
                                    '{{/if}}'+
                                '</div>'+
                            '</div>' +
                            /*'<input type="date" name="manyTimes" value="{{value}}" max = "{{maxTime}}" class="form-control w-150"/>'+
                            '{{if !manyTimes}}'+
                                '<button class="btn btn-pri manyTimes" id="manyTimes">发生多次</button>'+
                                '<button class="btn none-btn" id="noneDate">没有了</button>' +
                            '{{/if}}'+*/
                        '</div>'+
                        '<div class="ques_names">'+
                            '{{if manyTimes}}'+
                                '{{each manyTimes as times,i}}'+
                                    '<div class="clearfix ques_date" number = "{{times.number}}">' +
                                        '<div>'+
                                            '<input type="date" name="manyTimes" value="{{times.value}}" class="form-control"/>' +
                                        '</div>'+
                                        '<div>'+
                                            '{{if times.number == manyLens}}'+
                                            '<button class="btn btn-pri manyTimes" id="manyTimes">发生多次</button>' +
                                            '<button class="btn none-btn" id="noneDate">没有了</button>' +
                                            '{{/if}}'+
                                        '</div>'+
                                    '</div>'+
                                '{{/each}}'+
                            '{{/if}}'+
                        '</div>'+
                        '<div class="mark">'+
                            '{{include "mark-tpl"}}'+
                        '</div>'+
                    '</div>'+
                '</div>'+
            '</script>'
    };
    //时间段：
    var timeQuantum = function(){
        return '<script type="text/html" id="timeQuantum-tpl" >'+
                '<div class="panel panel-default" id="{{fuId}}.{{id}}" indexNo = "{{indexNo}}" type="timeQuantum" quesType = "les">'+
                    '<div class="panel-heading">{{itemTitle}}</div>'+
                    '<div class="panel-body">'+
                        '<div class="ques">'+
                            '<p class = "ques_title">{{ if title}}{{fuId}} {{/if}}{{title}}</p>'+
                        '</div>'+
                        '<div class="ques">'+
                            '{{indexNo}}.{{name}}：<input type="date" class="form-control w-150" name="startTime" value="{{value}}" max = "{{maxTime}}"/>'+
                        '</div>'+
                        '<div class="ques">该状况结束时间？</div>'+
                        '<div class="clearfix ques_single_tab">'+
                            '<div class="linkage_tab {{if endTime == option.A}}link_checked {{/if}}" name="endTime">{{option.A}}</div>'+
                            '<div class="linkage_tab {{if endTime && endTime != option.A}}link_checked {{/if}}" name="endTime">已结束</div>'+
                            '<input type="date" max = "{{maxTime}}" {{if endTime && endTime != option.A}} value = "{{endTime}}" {{else}} style="display:none;" {{/if}} name="endTime" class="form-control w-150"/>'+
                        '</div>'+
                        '<div class="text-center jump"><button class="btn btn-pri" id="noneDate">确认</button></div>'+
                        '<div class="mark">'+
                            '{{include "mark-tpl"}}'+
                        '</div>'+
                    '</div>'+
                '</div>'+
            '</script>'
    }

    /*
    *  提交弹窗：
     */
    tpl.toSubmit = function(){
        var html = '';
        html += toSubmit();
        return html;
    }
    var toSubmit = function(){
        return '<script type="text/html" id="toSubmit-tpl">'+
                    '<div class="modal fade {{className}}" tabindex="-1" role="dialog" >'+
                        '<div class="modal-dialog" role="document">'+
                            '<div class="modal-content">'+
                                '<div class="modal-body">'+
                                '</div>'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
                '</script>'
    }

    /*
    * LES提交弹窗：
     */
    tpl.lesSubmit = function(){
        var html = "";
        html += lesSubmit();
        return html;
    };
    var lesSubmit = function(){
        return '<script type="text/html" id="lesSubmit-tpl">'+
                    '<div class="text-center tips">'+
                       '{{if evaType == "LES"}}生活事件量表{{else if evaType == "OSI"}}妇女健康调查表{{else}}一般人口学信息{{/if}}已经全部完成'+
                    '</div>'+
                    '<div class="clearfix btnGroup">'+
                        '<button class="btn btn-default" id="backModify">返回修改</button>'+
                        '<button class="btn btn-pri pull-right" id="toSubmit">去提交</button>'+
                    '</div>'+
                '</script>'
    };
    return tpl;
});